package org.symkom.card;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JPanel;

import org.symkom.expression.SKObject;
import org.symkom.main.MainWindow;

public abstract class Card extends JPanel{
	MainWindow mainWindow;
	Card prevCard;
	List<SKObject> function;
	protected JButton nextButton;
	public Card(MainWindow mainWindow, Card prevCard) {
		this.prevCard = prevCard;
		this.mainWindow = mainWindow;
		
		init();
	}
	public  void init() {
		nextButton = new JButton("dalej");
		nextButton.addActionListener(new nextListener());
		function = new ArrayList<SKObject>();
		if(prevCard != null)
			function = prevCard.getFunction();
	}
	protected abstract void nextStage();
	
	protected class nextListener implements ActionListener {

		@Override
		public void actionPerformed(ActionEvent e) {
			nextStage();
		}	
	}
	private List<SKObject> getFunction() {
		return function;
	}
}
